﻿
using DLL.NET50.DB.PIVAS.Entitys.DTO;
using DLL.NET60.DB.MS.Entity.DTO;
using System;
using System.Collections.Generic;
using System.Text;

namespace DLL.NET50.DB.MS.AdviceAndDrug
{
    public class CDrugInitialize
    {
               

        public static bool PropertyIsSet(DTO_adi_dic_drug drug)
        {
            if
                (
                     drug.DRUG_CODE == null ||
                    drug.DRUG_CODE.Length < 1 ||
                    drug.DRUG_NAME == null ||
                    drug.DRUG_NAME.Length < 1 ||
                    drug.DOSE_UNIT == null ||
                    drug.MAFC_NAME == null ||
                    drug.MAFC_NAME.Length < 1 ||
                    drug.SOLVENT_FLAG == null ||
                    drug.NEEDLE_TYPE == null ||
                    drug.PY_CODE == null ||
                    drug.PY_CODE.Length < 1
                    
                )
            {
                return false;
            }
            return true;
        }

        public static DTO_adi_dic_drug PivasCopyToDicDrug(DTO_pivas_read_drugs newPivasDrug, DTO_adi_dic_drug oldDicDrug)
        {
            DTO_adi_dic_drug dstDrug = (DTO_adi_dic_drug)oldDicDrug.Clone();
            dstDrug.DRUG_CODE = newPivasDrug.DRUG_CODE;
            dstDrug.DRUG_NAME = newPivasDrug.DRUG_NAME;
            dstDrug.DOSE = (float)newPivasDrug.DOSE;
            dstDrug.SPECIFICATION = newPivasDrug.SPECIFICATION;
            dstDrug.DOSE_UNIT = newPivasDrug.DOSE_UNIT;
            dstDrug.MAFC_NAME = newPivasDrug.MAFC_NAME;
            dstDrug.PY_CODE = newPivasDrug.PY_CODE;
            dstDrug.ApprovalNumber = newPivasDrug.APPROVAL_NUMBER;
            return dstDrug;
        }

    }
}
